

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>

<c:set var="book" value="${requestScope.BOOKDETAIL}"/>
<c:set var="bookDescription" value="${requestScope.BOOKDESCRIPTION}"/>
<c:set var="user" value="${sessionScope.USER}"/>
<c:set var="role" value="${user.roleID}"/>

<td class="centerContainer">
    <div class="c1">
        <div class="c2">
            <div class="top"></div>
        </div>
    </div>

    <div class="content">
        <div class="content-wrapper">
            <a name="main"></a>
            <span id="serch_error">
            </span>

            <div class="productDetailsSection" itemscope="" itemtype="http://schema.org/Book">
                <div class="block">
                    <div class="cont">
                        <span id="product_error">
                        </span>

                        <div class="leftContent">
                            <div class="largeImageBlock">
                                <div class="pikachoose">
                                    <div class="pika-stage"><img src="${book.bookImg}" style="left: 0px;"></div>
                                </div>
                            </div>	
                        </div>

                        <div class="rightContent">
                            <h1 class="productName" itemprop="name">${book.bookName}</h1>
                            <div class="productInfoTop">
                                <div class="productPriceBlock">
                                    <span class="total">
                                        <div itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> 
                                            <span itemprop="price" id="product_price">${book.bookPrice}</span>
                                            <meta itemprop="priceCurrency" content="GBP">
                                            <meta itemprop="availability" content="InStock">
                                        </div>
                                    </span>
                                </div>


                                <div class="productAttributes">

                                    <c:set var="pages" value="${book.bookPages}"/>
                                    <c:set var="format" value="${book.bookFormat}"/>
                                    <c:set var="author" value="${book.bookAuthor}"/>
                                    <c:set var="publishedDate" value="${book.bookPublishedDate}"/>
                                    <c:set var="ISBN" value="${book.bookISBN}"/>
                                    <c:set var="edition" value="${book.bookDetailedEdition}"/>

                                    <c:if test="${not empty pages}">
                                        <div class="productAttribute">
                                            <label>Pages: </label><span>${pages}</span>
                                        </div>    
                                    </c:if>
                                    <c:if test="${not empty format}">
                                        <div class="productAttribute">
                                            <label>Format: </label><span>${format}</span>
                                        </div>
                                    </c:if>
                                    <c:if test="${not empty author}">
                                        <div class="productAttribute">
                                            <label>Author: </label><span>${author}</span>
                                        </div>
                                    </c:if>
                                    <c:if test="${not empty publishedDate}">
                                        <div class="productAttribute">
                                            <label>Published Date: </label><span>${publishedDate}</span>
                                        </div>
                                    </c:if>
                                    <c:if test="${not empty ISBN}">
                                        <div class="productAttribute">
                                            <label>ISBN: </label><span>${ISBN}</span>
                                        </div>
                                    </c:if>
                                    <c:if test="${not empty edition}">
                                        <div class="productAttribute">
                                            <label>Detailed Edition: </label><span>${edition}</span>
                                        </div>
                                    </c:if>
                                </div>
                            </div> 

                            <c:if test="${not empty user and role == 2}">
                                <form action="ProcessServlet" method="POST">
                                    <div class="buyBlock">
                                        <div class="qty">
                                            <strong>Quantity:&nbsp;</strong>
                                            <select name="ddlQuantity" class="textInput">
                                                <option>1</option>
                                                <option>2</option>
                                                <option>3</option>
                                                <option>4</option>
                                                <option>5</option>
                                                <option>6</option>
                                                <option>7</option>
                                                <option>8</option>
                                                <option>9</option>
                                                <option>10</option>
                                            </select>
                                        </div>
                                        <input id="buy_button" class="bigBtn rightBtn" type="submit" value="Add to Cart" name="btAction">
                                        <input type="hidden" name="txtBookID" value="${book.bookID}"/>
                                    </div>
                                </form>
                            </c:if>

                            <div class="productInfoTabs">
                                <div class="tabsWrapper" style="display: block;">
                                    <ul class="tabs-nav">
                                        <li class="description"><a href="#" class="current">Description</a></li>
                                    </ul>
                                    <!-- tab panes -->
                                    <div class="tabs-panes">
                                        <div class="productDescriptionText" itemprop="description" style="display: block;">
                                            <div>
                                                <c:forEach var="description" items="${bookDescription}">
                                                    ${description}
                                                    <br>
                                                    <br>
                                                </c:forEach>
                                            </div>
                                        </div>
                                    </div>
                                </div>				
                            </div>
                        </div>
                        <div class="nofloatLast"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="c4">
        <div class="c3">
            <div class="btm"></div>
        </div>
    </div>
</td>
